<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>测试跨域</title>
</head>
<body>
    <h1>测试跨域</h1>
    <script>
        // localhost:8888/public/index.html 
        // liveserver启动会跨域 在server.js解决
        fetch('http://localhost:8888/products').then(res=>res.json()).then(res=>{
            console.log(res);
        })
    </script>
</body>
</html>